Skip to content

Conversation

@tcdent
Copy link
Contributor

@tcdent tcdent commented Mar 15, 2025

Thus implementation demonstrates a sustainable pattern for all instrumentation that gets included in AgentOps.

  • Uses semantic conventions exclusively.
  • All pertinent data is exported, including workflow input/output, tool use, and completions.
  • Spans nest under the parent trace and are opened/closed in a lifecycle that is compatible with agent's built-in tracing module.
  • Tooling for generating test data from Response objects from openai-agents and completions & responses from openai
  • Example code that uses handoffs.
  • Better span_names
    • agents.function should be something like agents.tool.<tool_name>
    • agents.response should have the agent name
  • Agent span is closing early? Should include the tool and llm calls within it's start/end times.
  • Completion data is getting merged with the agent. We should have separate spans for the agent making the action and then the llm call as a child span. This appears to be a limitation of the way openai_agents hands off to tracing; lots of things get categorized as response, but it works much better now.
  • instrumentation.openai is incomplete. I created it to be able to instrument responses api calls, but ended up incorporating that into the instrumentation.openai_agents. This will be applied in a new PR.
  • Attributes have tests, but the exporter/processor does not.

@tcdent tcdent requested a review from teocns March 15, 2025 09:05
Copy link
Member

@dot-agi dot-agi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tcdent for the PR! This is helpful in moving towards a more stable instrumentation for the OpenAI provider and Agents framework.

I have requested some changes primarily on the semantic conventions being used to record the attributes. This would prevent duplication of data and provide an ordered structure of extracting data from queries in the backend.

@tcdent tcdent marked this pull request as draft March 15, 2025 17:40
@tcdent
Copy link
Contributor Author

tcdent commented Mar 15, 2025

@the-praxs Did you run this? Post your script and output below.

@dot-agi
Copy link
Member

dot-agi commented Mar 15, 2025

@the-praxs Did you run this? Post your script and output below.

https://gist.github.com/the-praxs/73fe232afb46c6cccb110dd4de9db0ba

@tcdent tcdent marked this pull request as ready for review March 24, 2025 19:51
@dot-agi dot-agi self-requested a review March 24, 2025 19:59
@dot-agi
Copy link
Member

dot-agi commented Mar 24, 2025

@dot-agi
Copy link
Member

dot-agi commented Mar 24, 2025

Tested streaming with examples/agents-examples/basic/stream_text.py and it works as expected.

Copy link
Member

@dot-agi dot-agi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM AND YOLO

tcdent and others added 3 commits March 24, 2025 16:29
* Log deeplink to trace on AgentOps dashboard.

* Test coverage, type checking.

* Get app_url from config.

* Don't format trace_id in the URL as a UUID, just a hex string.
@dot-agi dot-agi merged commit c1a4015 into main Mar 24, 2025
7 of 10 checks passed
@dot-agi dot-agi deleted the serialization-fix-test branch March 24, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Agents SDK to correctly export spans

3 participants